
function register_id_verify(){
    var element = $("#InputID");
    var str = element.val();
    var reg = /^\d+$/;
    var is = reg.exec(str);
    var span = $("#InputID_text");
    var path = $("#hidden_info").attr("rel");
    mark = false;
    $.post(path+"/Admin/valid", {id:str},function (data){
        if(is){
            if(data.flag){
                span.html("<img src="+path+"/images/right.png alt=\"right\" width=\"15px\" height=\"15px\" >正确");
                span.attr("style","color: green;margin-left: 5px;");
                mark = true;
                // alert("里面"+mark);
            }else{
                span.html("<img src="+path+"/images/error.png alt=\"error\" width=\"15px\" height=\"15px\">工号已存在");
                span.attr("style","color: red;margin-left: 5px;");
                mark = false;
                // alert("里面"+mark);
            }

        }else{
            span.html("<img src="+path+"/images/error.png alt=\"error\" width=\"15px\" height=\"15px\">工号不能为空或非数字");
            span.attr("style","color: red;margin-left: 5px;");
            mark = false;
            // alert("里面"+mark);
        }

        // return false;
    });
    // alert("外面"+mark);
    return mark;
}

function register_psw_verify(){
    var element = $("#InputPassword");
    var str = element.val();
    var span = $("#InputPassword_text");
    var path = $("#hidden_info").attr("rel");
    if(str){
        span.html("<img src="+path+"/images/right.png alt=\"right\" width=\"15px\" height=\"15px\">正确");
        span.attr("style","color: green;margin-left: 5px;");
        return true;
    }else{
        span.html("<img src="+path+"/images/error.png alt=\"error\" width=\"15px\" height=\"15px\">密码不能为空");
        span.attr("style","color: red;margin-left: 5px;");
        return false;
    }
}

function register_name_verify(){
    var element = $("#InputName");
    var str = element.val();
    var span = $("#InputName_text");
    var path = $("#hidden_info").attr("rel");
    if(str){
        span.html("<img src="+path+"/images/right.png alt=\"right\" width=\"15px\" height=\"15px\">正确");
        span.attr("style","color: green;margin-left: 5px;");
        return true;
    }else{
        span.html("<img src="+path+"/images/error.png alt=\"error\" width=\"15px\" height=\"15px\">姓名不能为空");
        span.attr("style","color: red;margin-left: 5px;");
        return false;
    }
}

function register_phone_verify(){
    var element = $("#InputPhone");
    var str = element.val();
    var reg = /^[\d]{11}$/;
    var is = reg.exec(str);
    var span = $("#InputPhone_text");
    var path = $("#hidden_info").attr("rel");
    if(is){
        span.html("<img src="+path+"/images/right.png alt=\"right\" width=\"15px\" height=\"15px\">正确");
        span.attr("style","color: green;margin-left: 5px;");
        return true;
    }else{
        span.html("<img src="+path+"/images/error.png alt=\"error\" width=\"15px\" height=\"15px\">电话号码不能为空或有误");
        span.attr("style","color: red;margin-left: 5px;");
        return false;
    }
}

